<!--
 * @Descripttion: 出手鸭小程序
 * @version:1.0.1 
 * @Author: HHL
 * @Date: 2022-12-06 17:09:02
 * @LastEditTime: 2023-10-13 10:41:48
 * @LastEditors:Hui
-->
<template>
  <view>
    <view class="main" v-if="!url">
      <view class="title">对不起，您访问的页面不存在</view>
      <button class="u-default-btn btn" @click="goHome">
        返回首页
      </button>
    </view>
    <web-view :src="decodeURIComponent(url)" v-else />
  </view>
</template>

<script>
export default {
  data() {
    return {
      url: '',
    }
  },
  onLoad(option) {
    const { url } = option
    url && (this.url = url)
  },

  methods: {
    goHome() {
      uni.switchTab({ url: '/pages/index/index' })
    }
  }
}
</script>

<style lang="scss" scoped>
.main{
  padding-top: 40%;
  .title{
    padding: 40rpx 0 60rpx;
    font-size: 30rpx;
    line-height: 80rpx;
    color: #333;
    text-align: center;
  }

  .btn{
    width: 458rpx;
    border-radius: 45rpx;
    line-height: 90rpx;
    margin: 0 auto;
  }
}
</style>